function wholeWord=ParityCheck(preWord,curWord)
    for i=1:24
        cw(i)=str2num(curWord(i));
    end
    for i=1:30
        pw(i)=str2num(preWord(i));
    end
    c=1-2*cw;
    p=1-2*pw;
    w(1:24)=p(30)*c(1:24);
    w(25)=p(29)*c(1)*c(2)*c(3)*c(5)*c(6)*c(10)*c(11)*c(12)*c(13)*c(14)*c(17)*c(18)*c(20)*c(23);
    w(26)=p(30)*c(2)*c(3)*c(4)*c(6)*c(7)*c(11)*c(12)*c(13)*c(14)*c(15)*c(18)*c(19)*c(21)*c(24);
    w(27)=p(29)*c(1)*c(3)*c(4)*c(5)*c(7)*c(8)*c(12)*c(13)*c(14)*c(15)*c(16)*c(19)*c(20)*c(22);
    w(28)=p(30)*c(2)*c(4)*c(5)*c(6)*c(8)*c(9)*c(13)*c(14)*c(15)*c(16)*c(17)*c(20)*c(21)*c(23);
    w(29)=p(30)*c(1)*c(3)*c(5)*c(6)*c(7)*c(9)*c(10)*c(14)*c(15)*c(16)*c(17)*c(18)*c(21)*c(22)*c(24);
    w(30)=p(29)*c(3)*c(5)*c(6)*c(8)*c(9)*c(10)*c(11)*c(13)*c(15)*c(19)*c(22)*c(23)*c(24);
    ww=(1-w)/2;
    for i=1:30
        wholeWord(i)=num2str(ww(i));
    end
end